package com.test07;

//声明一个医生Doctor类型，声明一个swapHeart(Body b1, Body b2)方法，为两个人换心脏，并交换健康状况
public class Doctor {
    public void swapHeart(Body b1, Body b2){
        Organ b = b2.getHeart();
        b2.setHealth(b1.getHeart());
        b2.setHeart(b1.getHeart(), b2);



        b1.setHealth(b);
        b1.setHeart(b, b1);

    }
}
